package com.cy.util;

import com.google.errorprone.annotations.Var;

import java.util.HashMap;
import java.util.Optional;
import java.util.function.BiFunction;
import java.util.function.Supplier;

public class ttttt {

	public static void main(String[] args) {
		HashMap<String, Integer> map = new HashMap<>();
		Integer res = map.compute("a", (s, integer) -> {
			if (integer == null) {
				return 1;
			}
			return integer + 1;
		});
		System.out.println(res);

		res = map.compute("a", (s, integer) -> {
			return integer == null ? 1 : integer + 1;
		});
		System.out.println(res);

	}
}
